package com.hd.springbootstudy.service.impl;

import com.hd.springbootstudy.dao.UserMapper;
import com.hd.springbootstudy.entity.User;
import com.hd.springbootstudy.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Author: Lemon
 * @Date: 2021/4/20 21:41
 */

/**
 * 将service层交给spring ioc 容器管理
 */
@Service
public class UserServiceImpl implements IUserService {

    /**
     * 自动注入接口
     * 接口类型 接口名
     * 区别于@Resource @Resource需要写明路径
     */
    @Autowired
    protected UserMapper userMapper;

    @Override
    public boolean insertUser(User user) {
        userMapper.insert(user);
        return true;
    }
}
